package org.jaaksi.demo.touche;

import android.view.MotionEvent;

/**
 * Created by Fcy on 2016/4/20.
 */
public class ActionUtil {
    public static String getAction(MotionEvent event) {
        String result = "other";
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                result = "ACTION_DOWN";
                break;
            case MotionEvent.ACTION_CANCEL:
                result = "ACTION_CANCEL";
                break;
            case MotionEvent.ACTION_UP:
                result = "ACTION_UP";
                break;
        }
        return result;
    }

    public static String getAction(String methodName, MotionEvent event) {
        return "的" + methodName + ":" + getAction(event);
    }

    public static String getAction(String methodName, MotionEvent event, boolean back) {
        return "的" + methodName + ":" + getAction(event) + ",返回:" + back;
    }

}
